<?php

namespace AdminBundle\Repository;


class HuobiAmazingLogRepository extends BaseRepository
{
    /**
     * @param int $length 获取数据的长度
     * @param int $duration 时间跨度
     * @param int $coin 币
     * @param int $timestamp 时间戳
     * @return bool
     *
     * @throws \Exception
     */
    public function getAmazing($length = 200, $duration = 60, $coin = '', $timestamp = 0, $version = '')
    {
        $sql = "call proc_amazing_log(:length,:time_stamp,:duration, :coin, :version)";
        $timestamp = $timestamp ?: time();
        $params = ['length' => $length, 'time_stamp' => $timestamp,
            'duration' => $duration, 'coin' => $coin, 'version' => $version];

        return $this->rawQuery($sql, $params);
    }

}
